<?php
/**
 * 对比 抓取小区数据
 */
ini_set('memory_limit', '4024M');
header("content-type:text/plain;charset=utf8");
require './include/CurlMulti.php';
require './include/config.php';


$type_list = array(0=>'共有小区',1=>'未覆盖小区(百度有，我们没有)', 2=>'我们有百度没有');

if (!isset($_GET['type'])) {
    echo json_encode($type_list);
    exit;
}

$type = intval($_GET['type']);
// 默认输出 '未覆盖小区(百度有，我们没有)'
isset($type_list[$type]) || $type = 1;
$list = getDiffxiaoqu($type, $file= "./log/diff_xiaoqu_es_esf_xiaoqu_new.log");
foreach ($list as $item) {
    $data[str_replace(array("[","]"), "", $item["baidu_geo"])] = $item['name'];
}
echo json_encode($data);